<!DOCTYPE html>
<html>
<head>
	<title>公告发送记录</title>
	{{>/WEB-INF/pages/common/meta_base.part.html}}
	{{>/WEB-INF/pages/common/refs_base.part.html}}
</head>
<body>
{{>/WEB-INF/pages/common/layout_header.part.html}}
<div class="container">
	<ul class="breadcrumb">
	  <li><a href="{{ctx}}">首页</a></li>
	  <li><a href="{{ctx}}/system/cloud">云服务</a></li>
	  <li class="active">公告</li>
	</ul>
	<hr class="hr1">
	<div class="hr-10"></div>
	<div class="hr-10"></div>
	<div class="hr-10"></div>
	{{#message}}
		<script type="text/javascript">
			bootbox.alert('<h4>{{message}}</h4>');
		</script>
	{{/message}}
	<div style="margin:10px 20px 10px">
		<div class="row">
			<div class="col-sm-7" style="padding-right:0">
			{{>/WEB-INF/pages/common/simplequery.part.html}}
			</div>
			<div class="col-sm-5" style="padding-left:0">
				<a class="btn btn-primary" href="{{ctx}}/notice/create?appId={{appId}}">创建公告</a>
			</div>
		</div>
    </div>
    <div class="table-responsive">
	<table id="contentTable" class="table table-striped table-bordered table-hover">
		<thead><tr>
		<th width="180px">标题</th><th class="contentCls">内容</th><th width="180px">接收角色</th><th width="160px">所属应用</th>
		<th width="180px">创建时间</th><th width="80px">操作</th>
		</tr></thead>
		<tbody>
		{{#notices.content}}		
			<tr>
				<td>{{title}}</td>
				<td class="contentCls">
					<pre>{{content}}</pre>
				</td>
				<td>
				{{#roles}}
					<label class="label label-info" style="display:inline-block">{{.}}</label>
				{{/roles}}
				{{^roles}}
					所有角色
				{{/roles}}
				</td>
				<td>{{appName}}</td>
				<td>
				<script type="text/javascript">
					document.write($.format.date(
							"{{createTime}}",
							"yyyy-MM-dd HH:mm:ss"))
				</script>
				</td>
				<td>
				{{#pushRequestId}}
				<a href="{{ctx}}/notice/push-detail/{{pushRequestId}}?appId={{appId}}">推送详情</a><br/>
				{{/pushRequestId}}
				<a href="javascript:void(0)" onclick="deleteItem('{{ctx}}/notice/delete?id={{id}}&appId={{appId}}')">删除</a>
				</td>
			</tr>
		{{/notices.content}}
		</tbody>
	</table>
	</div>
	{{#page}}
	{{>/WEB-INF/pages/common/pagination.part.html}}
	{{/page}}
	{{>/WEB-INF/pages/common/layout_footer.part.html}}
	</div>
</body>
</html>

<script type="text/javascript">
function deleteItem(url){
	bootbox.confirm("是否确认删除该记录?",
		function(op) {
        	if (op) {
            	window.location.href=url;
            }
    	});
    }
</script>
